<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .tt{
        resize:none;
        font-size: 16px;
        color: blue;
    }
</style>
<body>
    <div id="app">
        <textarea class="tt" v-model="txt" rows="8" cols="40" ></textarea>
        <div v-html="mark"></div>
    </div>
</body>
</html>
<script src="https://cdn.bootcdn.net/ajax/libs/marked/1.2.7/marked.min.js"></script>
<script src='https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js'></script>
<script>
    let txt = new Vue({
        el:"#app",
        data:{
            txt:"#一级标题"
        },
        computed: {
            mark(){
                return marked(this.txt)
            }
        }
    })
</script>
